home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 November / Ahoy_Magazine_86-11_1986_Double_L.d64 / new recovery.txt < prev    next >
Text File  |  2022-10-26  |  6KB  |  211 lines

  1. DISK DIRECTORIES II:
  2. RECOVERING FROM PASS "N:NAME"
  3. by Phyrne Bacon
  4.  
  5. DISK'EDITOR and DIRECTORY'PROBE can
  6. be used together to recover files
  7. lost by accidentally typing a short
  8. new; that is:
  9.  
  10.  pass "n:name"  // without any id
  11.  
  12. Don't save anything on the disk with
  13. the missing files until the error has
  14. been corrected! If you haven't got a
  15. backup disk, now is the time to make
  16. one. Use a whole disk copier such as
  17. four minute backup. Put the original
  18. disk in a safe place, and work on the
  19. backup. We will call the backup "the
  20. damaged disk".
  21.  
  22. In Disk Directories I: Unscratching
  23. Files, we explained about disk
  24. directory files, directory entries,
  25. program block chains, unscratching
  26. files, and correcting the BAM.
  27.  
  28. I. Recovering from pass"n:name"
  29.  
  30. Now suppose that you used
  31. pass"n:name" (without any id) by
  32. accident on both your disk and its
  33. backup. (It has happened to me!) If
  34. you used pass"n:name,id", your files
  35. cannot be recovered.
  36.  
  37. The sectors in the directory are
  38. chained like those in a program. Look
  39. at track 18, sector 4. If it has any
  40. entries (even scratched ones), the
  41. first two bytes of block 18-1 should
  42. be 18 and 4 (12 and 04 in hex). If
  43. 18-4 has directory entries, and the
  44. first two bytes of 18-1 are not 18
  45. and 4, use DISK'EDITOR to change
  46. these two bytes. Remember to save
  47. 18-1 after you make each set of
  48. changes.
  49.  
  50. If you changed the first two bytes of
  51. 18-1 to 18 and 4, use pass"v" to
  52. correct the BAM, and you will have
  53. recovered all the files on the disk
  54. except those whose entries were in
  55. 18-1.
  56.  
  57. Sector 18-1 has zeros everywhere
  58. except the second byte (which is
  59. 255), and reconstructing the first
  60. eight entries may be extremely
  61. difficult.
  62.  
  63. II. Restoring file entries.
  64.  
  65. Begin by running DIRECTORY PROBE with
  66. the damaged disk, and ask for the
  67. fragments and answer no to "complete
  68. block chains?". Unless you have saved
  69. something on the disk since the
  70. pass"n:name", your missing files
  71. should all be listed in the list of
  72. fragments at the end of the printout
  73. along with parts of previously
  74. scratched programs.
  75.  
  76. You have to find out which ones (if
  77. any) are the missing files.
  78.  
  79. Take a new disk, and format it by
  80. typing pass"n:new disk,zq". It should
  81. have a different id from the damaged
  82. disk.
  83.  
  84. Then save the one-line program:
  85. 10 print"hi
  86. nine times on the new disk. Use the
  87. filenames "a1" through "a9".
  88.  
  89. Copy block 18-1 of the new disk onto
  90. block 18-1 of the damaged disk by
  91. using DISK'EDITOR load and save. If
  92. there are no entries in block 18-4
  93. change the first two bytes of 18-1 of
  94. the damaged disk to 0 and 255 (00 ff
  95. in hex).
  96.  
  97. Now we need to choose the most likely
  98. fragments and to change the
  99. track/sector of each directory entry
  100. in block 18-1 on the damaged disk to
  101. the track/sector of one of the chosen
  102. chain fragments. Label the chosen
  103. fragments as a1-a8 on the printout.
  104.  
  105. Use DISK'EDITOR to help choose the
  106. fragments. A first block of a listed
  107. COMAL program will be easy to read in
  108. the right column. A COMAL 2.0 program
  109. will begin with the hex bytes: ff ff
  110. 02 00 00, but remember that the first
  111. two bytes of the block are not part
  112. of the program; so that it is the
  113. third and fourth bytes which are ff
  114. ff in hex. Almost all BASIC programs
  115. begin with the hex bytes: 01 08. A
  116. COMAL 0.14 program may be
  117. recognizable if its name appears in a
  118. remark near the beginning. The line
  119. number # of the first line of a COMAL
  120. 0.14 program appears in the first and
  121. second columns of the second row in
  122. high-byte/low-byte form (# = hi*256 +
  123. lo). The third column contains the
  124. link number: where the next line
  125. starts. If the fourth column of the
  126. second row contains 00 in hex, the
  127. first line is a remark.
  128.  
  129. Say the fragment begins on 17-0
  130. (track 17 sector 0). Change the
  131. fourth byte of the directory entry to
  132. 17 and the fifth to 0. To enter 17,
  133. move the cursor to the correct
  134. position, press n, enter 17, and
  135. press return. Usually the first files
  136. saved begin in tracks near the
  137. directory track, that is, near track
  138. 18. If you wonder if a fragment is a
  139. file of a certain type, compare its
  140. first block or so to a known file of
  141. that type. Guess a file type for each
  142. file and enter the guess on the disk
  143. and the printout.
  144.  
  145. DIRECTORY PROBE printed the chain
  146. length for the fragment (the number
  147. of blocks in the file), say 8. Change
  148. the byte in the seventh column of the
  149. last row of the directory entry to 8
  150. (or whatever).
  151.  
  152. Give each of the files a temporary
  153. name on the disk and on the printout,
  154. and use a file copying program to
  155. copy the eight files from the damaged
  156. disk to the new disk. Check the
  157. files. You may need to change your
  158. guess as to the file type. Incomplete
  159. COMAL 0.14 files usually crash COMAL.
  160. Be sure this hasn't happened before
  161. testing another COMAL 0.14 fragment
  162. file.
  163.  
  164. If there were more than eight block
  165. chain fragments, repeat the process
  166. for the next eight fragments if you
  167. haven't found your missing files.
  168.  
  169. When you are finished, use pass"v" on
  170. the damaged disk to update the BAM,
  171. and use cat to check the disk
  172. directory. Your files may need to be
  173. moved to the same disk.
  174.  
  175. If you have trouble making this
  176. method work, you may want to practice
  177. by making a copy of disk, say LAKE,
  178. similar to the damaged disk, use
  179. pass"n:sea" on LAKE, and then work on
  180. SEA where the correct answers are on
  181. LAKE.
  182.  
  183. III. Excessive noise from disk drive.
  184.  
  185. Frequently disk drives are out of
  186. alignment and the disk drives have
  187. trouble reading and writing near the
  188. outer tracks: 1 and 35. If you asked
  189. for fragments in DIRECTORY'PROBE, and
  190. the the disk drive makes a great deal
  191. of noise when the screen says
  192. "reading track 1", stop the program,
  193. and, in the procedure frag, change
  194. the limits on both of the lines "for
  195. g#:=1 to 35 do" to "for g#:=2 to 35
  196. do". Repeat this process if
  197. necessary.
  198.  
  199. With luck, all of the disk block
  200. chain fragments will still appear on
  201. the printout, and you will be able to
  202. recover all your files.
  203.  
  204. IV. More information.
  205.  
  206. An excellent source of further
  207. information is:
  208.  
  209. INSIDE COMMODORE DOS by R. Immers and
  210. G. Neufield ($19.95, Datamost)
  211.